/**用于选择的区域树*/
function showMenu() {
	var cityObj = $("#moduleName");
	var cityOffset = $("#moduleName").offset();
	//$("#menuContent").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
	$("#menuContent").css({}).slideDown("fast");
	$("body").bind("mousedown", onBodyDown);
}
function hideMenu() {
	$("#menuContent").fadeOut("fast");
	$("body").unbind("mousedown", onBodyDown);
}
function onBodyDown(event) {
	if (!(event.target.id == "menuBtn" || event.target.id == "areaName" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
		hideMenu();
	}
}
var setting = {
		async : {
			enable : true,
			url : ctp + "/moduleController/moduleTree.shtml",
			autoParam: ["code=moduleCode"]
		},
		data : {
			 simpleData: {
					enable: true
				}
		},
		callback : {
			onClick : zTreeOnClick
		}
	};
function zTreeOnClick(event, treeId, treeNode, clickFlag) {
	$("#parentModuleName").val(treeNode.name);
	$("#parentId").val(treeNode.code);
	hideMenu();
}	
$(function(){ 
    $.fn.zTree.init($("#treeDemo"), setting); 
}); 
